ThinkPHP5


think\response\Xml
library\think\response\Xml.php at line 16

Class Xml

Response
└─Xml

public class Xml
extends Response


Method Summary
protected mixed

output(mixed data)

处理数据

protected string

xmlEncode(mixed data, string root, string item, string attr, string id, string encoding)

XML编码

protected string

dataToXml(mixed data, string item, string id)

数据XML编码

Methods inherited from think\Response
__construct, cacheControl, code, content, contentType, create, data, eTag, expires, getCode, getContent, getData, getHeader, header, lastModified, options, output, send

Method Detail

library\think\response\Xml.php at line 29

output

protected mixed output(mixed data)

处理数据

Parameters:
data - 要处理的数据

library\think\response\Xml.php at line 45

xmlEncode

protected string xmlEncode(mixed data, string root, string item, string attr, string id, string encoding)

XML编码

Parameters:
data - 数据
root - 根节点名
item - 数字索引的子节点名
attr - 根节点属性
id - 数字索引子节点key转换的属性名
encoding - 数据编码

library\think\response\Xml.php at line 70

dataToXml

protected string dataToXml(mixed data, string item, string id)

数据XML编码

Parameters:
data - 数据
item - 数字索引时的节点名称
id - 数字索引key转换为的属性名

ThinkPHP5